<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:web="http://www.web.com.br/jsf/webutils">

	<!--

     TAG ATTRIBUTES:

        backingBean: O ManageBean que irá receber o valor selecionado

    -->
      
	<p:dialog id="_searchParticipanteDialog"
		header="#{messages['search.local.msg']}"
		widgetVar="searchParticipanteDialog" resizable="false" modal="true">

		<h:form id="searchParticipanteDialogForm"
			enctype="multipart/form-data">

			<fieldset id="fieldSearchParticipante" style="padding: 10px;">

				<legend style="font-weight: bold; font-size: 16px; width: auto;">#{messages['global.filtro.fieldset']}</legend>

				<!-- Bloco de Entidade -->
				<h:panelGrid columns="2">

					<web:outputTextField id="searchParticipanteNomeLabel"
						value="#{messages['label.nome']}:" required="false" width="120px"
						align="right" />

					<web:fieldInputText id="fieldTextParticipanteSearchNome"
						value="#{participanteUI.filter.nome}" required="true"
						width="200px" />

				</h:panelGrid>
				<!-- ************ -->

				<!-- Botões -->
				<h:panelGrid columns="2">

					<web:outputTextField id="btnParticipanteSearchLabel" value=".:"
						required="false" width="120px" align="right" />

					<p:commandButton id="btnParticipanteSearch"
						value="#{messages['global.msg.search']}"
						update="particpantesDataTable"
						process="searchParticipanteDialogForm"
						actionListener="#{participanteUI.search}"
						global="false" />

				</h:panelGrid>
				<!-- ************** -->

			</fieldset>

			<fieldset id="fieldResultadoParticipante"
				style="padding: 10px; height: 300px;">

				<legend style="font-weight: bold; font-size: 16px; width: auto;">#{messages['global.result.fieldset']}</legend>

				<web:dataTable id="particpantes" value="#{participanteUI.rows}"
					paginator="true" rows="7" style="width: 900px;" scrollable="false"
					dynamic="false">

					<ui:define name="columns">

						<web:column id="columnBotaoExcluir" align="center" width="100px">

							<p:commandButton id="selectBtn" process="@this" immediate="true"
								oncomplete="searchParticipanteDialog.hide()"
								title="#{messages['global.msg.select']}" icon="ui-icon-check"
								global="false">

								<f:setPropertyActionListener value="#{dataTableItem}"
									target="#{backingBean.bean.participante.cadastro}" />

							</p:commandButton>

						</web:column>

						<web:column id="columnParticipanteNome"
							title="#{messages['label.razaosocial']}" align="center">
							<h:outputText style="text-align: center; display: block;"
								value="#{dataTableItem.razaoSocial}" />
						</web:column>

					</ui:define>

				</web:dataTable>

			</fieldset>

		</h:form>

	</p:dialog>

</ui:composition>